<?
	class RelatedBO extends BusinessObject {
		function setAttributes(){
			$this->fields   = array
      (
				'id' 			=>	'relID',
				'item'   =>  'relItem',
   				'related'			=>	'relRelated'
			);
			BusinessObject::setAttributes();
		}
		/* constructor */
		function RelatedBO (){
			BusinessObject::BusinessObject ("related_items");
			 $this->setAttributes();
		}
		function returnRelated ($indexArray) {
			$rel = new RelatedBO();
			$rel->item = $indexArray;
			$rel->load();
			$i = 0;
			$result = array();
			while ($rel->next()) {
				if (!in_array($rel->related,$indexArray)) {
					$result[$i] = $rel->related;
					$i = $i + 1;
				}
			}
			return $result;
		}
	}
?>